<template>
  <div class="bg-white">
    <div class="container clearfix">
      <div class="blueauth-top clearfix">
        <div class="fl blueauth-left">
          <p class="title">认证品类</p>
          <div class="blueauth-type">
            <ul class="mgt-10">
              <!-- v-trigger -->
              <li v-for="(item,index) in categorylist" :key="index" @click="getAuthLevel2(item)">
                <p class="clearix">{{item.title}}</p>
                <ul class="list clearfix">
                  <li v-for="(item,index) in brandlist" :key="index">
                    <router-link to="">{{item.title}}</router-link>
                  </li>
                  <!-- <li>
                    <router-link to="">品牌1</router-link>
                  </li>
                  <li>
                    <router-link to="">品牌1</router-link>
                  </li>
                  <li>
                    <router-link to="">品牌1</router-link>
                  </li>
                  <li>
                    <router-link to="">品牌1</router-link>
                  </li>
                  <li>
                    <router-link to="">品牌1</router-link>
                  </li> -->
                </ul>
              </li>
            </ul>
            <!-- <p class="tip">木制品</p> -->
            <!-- <ul class="list clearfix">
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
            </ul> -->
          </div>
          <!-- <div class="blueauth-type">
            <p class="tip">木制品</p>
            <ul class="list clearfix">
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
              <li>
                <router-link to="">品牌1</router-link>
              </li>
            </ul>
          </div> -->
        </div>
        <div class="fl blueauth-center">
          <video :src="videobannerlist.video" controls="controls"></video>
        </div>
        <div class="fl blueauth-right">
          <p>AA认证资料下载（表格/word）</p>
          <p>AA认证资料下载（表格/word）</p>
          <p>AA认证资料下载（表格/word）</p>
        </div>
      </div>
      <div class="blueauth-bottom">
        <p class="blueauth-bottom-title">认证</p>
        <div class="clearfix">
          <ul class="blueauth-bottom-list clearfix fl">
            <li v-for="(authlist,index) in authlists" :key="index" @click="toLvcaiAuthlist(authlist)">
              <a href="javascript:void(0);">
                <img :src="authlist.logo" alt="">
                <p>{{authlist.title}}</p>
              </a>
            </li>
            <!-- <li><router-link to="Blueauth_list">
              <img src="../../../static/images/img/lvcaijia.jpg" alt="">
              <p>xxxx</p>
            </router-link></li>
            <li><router-link to="Blueauth_list">
              <img src="../../../static/images/img/lvcaijia.jpg" alt="">
              <p>xxxx</p>
            </router-link></li>
            <li><router-link to="Blueauth_list">
              <img src="../../../static/images/img/lvcaijia.jpg" alt="">
              <p>xxxx</p>
            </router-link></li>
            <li><router-link to="Blueauth_list">
              <img src="../../../static/images/img/lvcaijia.jpg" alt="">
              <p>xxxx</p>
            </router-link></li>
            <li><router-link to="Blueauth_list">
              <img src="../../../static/images/img/lvcaijia.jpg" alt="">
              <p>xxxx</p>
            </router-link></li> -->
          </ul>
          <div class="fr blueauth-bottom-link">
            <router-link to="Blueauth_process" class="block"><img src="../../../static/images/img/lvcaijia.jpg" alt=""></router-link>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import jquery from '../../assets/js/jquery-1.10.2.min.js'
import axios from 'axios'
export default {
  name:'Blueauth',
  data(){
      return{
        authlists:[],
        authlist:{},
        forminline:{
          industry_id:'',
          category_id:'',
          brand_id:'',
          is_position:''
        },
        videobannerlist:{
          video:''
        },
        brandlist:[],
        categorylist:[],
        categoryitem:{
        }
      }
  },
  methods:{
    // 认证品牌分类菜单
    getAuthLevel1 () {
      var that=this
      axios.get('/certification/category')
      .then(function(res){
        res = res.data
        that.categorylist = res.response
      })
    },
    getAuthLevel2 (categoryitem) {
      var that=this
      axios.get('/certification/brand',{params:{industry_id:that.categoryitem.industry_id}})
      .then(function(res){
        res = res.data
        that.brandlist = res.response
      })
    },
    // getAuthLevel3 () {
    //   var that=this
    //   axios.get('/certification/positionVideo')
    //   .then(function(res){
    //     res = res.data
    //     that.videobannerlist = res.response
    //   })
    // },
    // 认证视频 banner 位置
    getAuthvideo () {
      var that=this
      axios.get('/certification/positionVideo')
      .then(function(res){
        res = res.data
        that.videobannerlist = res.response[0]
      })
    },
    // 绿采认证详情
    // ,{params: {
    //         industry_id: this.forminline.industry_id,
    //         category_id: this.forminline.category_id,
    //         brand_id: this.forminline.brand_id,
    //         is_position: this.forminline.is_position,
    //       }}
    getAuthLists () {
      var that=this
      axios.get('/certification/list')
      .then(function(res){
        res = res.data
        that.authlists = res.response
      })
    },
    // 点击认证列表 进入详情
    toLvcaiAuthlist(authlist) {
      console.log(authlist)
      this.$router.push({
        name: 'Blueauth_detail2', params: {authlist: JSON.stringify(authlist)}
        //path:'/Blueauth_detail2/${authlist.id}',
        // query: {goodsList: goodsList}
        // 解决传过来的参数值在刷新页面后丢失
        //query: {authlist: JSON.stringify(authlist)}
      })
    }
  },
//   directives:{
//     trigger:{
//      inserted(el,binging){
//         el.click()
//        //$(el).trigger('click')
//       }
//    }
// },
  created:function () {
    this.getAuthLists();
    this.getAuthvideo();
    this.getAuthLevel1();
    this.getAuthLevel2();
    this.$emit('public_header', false);
    this.$emit('public_headerhover', true);
    this.$emit('public_footer', true);
  },
}
</script>

<style>
 @import '../../../static/style/blueauth';
</style>
